<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="${basePath}" target="_self"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>病人信息列表</title> 
    <#include "/template/head.html">
    <script type="text/javascript">
    $(function() {
      var curPageNo = ${pagination.pageNo};
      var totalPage = ${pagination.totalPage};
      var _pageNo = $('#pageNo'), _pageForm = $('#brxxListForm');
      var _first = $('#first'),  _back = $('#back'), _next = $('#next'), _last = $('#last');
      
      if(curPageNo> 1){
      	_first.click(function() {
          _pageNo.val(1);
          _pageForm.submit();
        });
      	_first.addClass('pointer');
        _back.click(function() {
          _pageNo.val(parseInt(curPageNo)-1);
          _pageForm.submit();
        });
        _back.addClass('pointer');
      }
      
      if(curPageNo < totalPage){
      	_last.click(function() {
          _pageNo.val(totalPage);
          _pageForm.submit();
        });
        _last.addClass('pointer');
        _next.click(function() {
          _pageNo.val(parseInt(curPageNo)+1);
          _pageForm.submit();
        });
        _next.addClass('pointer');
      }
      
      _pageForm.validate({
        rules:{
          pageSize: {required:true, min:1},
          pageNo: {range:[1,totalPage]}
        },
        messages:{
          pageSize: {required: "每页要显示多少条数据", min: "每页最少显示一条数据"},
          pageNo: {range: "页码范围在1和" + totalPage + "之间"}
        },
        errorPlacement: function(error, element) {   
          alert(error.html());
        }
      });
      rotDis('djdw', 'selected', ['${dwdm_key.dwmc}'], 'submit_warp');
    });
    </script>
  </head>

  <body>
    <form id="brxxListForm" name="brxxListForm" action="" method="post">
      <table class="cmxform" cellspacing="1">
        <tr>
          <th width="80">KICID：</th>
          <td width="120">
            <input name="kicid" value="${query.kicid}" class="w100" maxlength="8"/>
          </td>
          <th width="90">病人登记号：</th>
          <td width="120"><input name="djhm" value="${query.djhm}" class="w100"/></td>
          <th width="70">登记日期：</th>
          <td colspan="2">
            <input name="djrqq" class="Wdate date" value="${djrqq}"/> 至 <input name="djrqz" class="Wdate date" value="${djrqz}"/>
          </td>
          <td rowspan="2"><img src="img/excel.png" class="noborder pointer" onclick="$('#brxxListForm').attr('action','${basePath}xls/brxx.do').submit()"/></td>
        </tr>
        <tr>
          <th>报告单位：</th>
          <td>
            <select name="djdw" onchange="rotDis('djdw', 'selected', ['${dwdm_key.dwmc}'], 'submit_warp')">
              <option value="">--全部--</option>
              <#list dwdms as item>
              <option value="${item.dwid}" <#if query.djdw?? && query.djdw.dwid?? && query.djdw.dwid==item.dwid>selected</#if>>${item.dwmc}</option>
              </#list>
            </select>
          </td>
          <th>状态：</th>
          <td>
            <span id="submit_warp" class="none">
              <select name="submit_flag" disabled="disabled">
                <option value="1" <#if query.submit?? && query.submit>selected</#if>>已提交</option>
                <option value="0" <#if query.submit?? && !query.submit>selected</#if>>未完成</option>
              </select>
            </span>
          </td>
          <th width="90">病人姓名：</th>
          <td width="120"><input name="brxm" value="${query.brxm}" class="w100"/></td>
          <td><button type="submit" class="search" onclick="$('#brxxListForm').attr('action','${basePath}brxx/list.do');"/>&nbsp;&nbsp;&nbsp;</td>
        </tr>
      </table>
      <table>
        <tr>
          <td>
            <table width="100%">
              <tr>
                <td width="15" height="30" style="background: url('img/tab_03.gif') no-repeat;">&nbsp;</td>
                <td style="background: url(${basePath}img/tab_05.gif) repeat-x ;">
                  <img src="img/311.gif" width="16" height="16" />
                  <h5 class="inline shadow">病人信息列表</h5>
                </td>
                <td width="14" height="30" style="background: url('img/tab_07.gif') no-repeat;">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table width="100%">
              <tr>
                <td style="background: url(img/tab_12.gif);width: 9px;">&nbsp;</td>
                <td style="background: #f3ffe3;">
                  <table class="list" cellspacing="1" onmouseover="changeto();" onmouseout="changeback();">
                    <thead>
                      <tr>
                        <th>KICID</th>
                        <th>登记号</th>
                        <th>姓名</th>
                        <th>性别</th>
                        <th>出生日期</th>
                        <th>登记单位</th>
                        <th>登记日期</th>
                        <th>状态</th>
                        <th width="100" nowrap="nowrap">操作</th>
                      </tr>
                    </thead>
                    <#list pagination.list as item>
                    <tr style="background: #FFF">
                      <td>${item.kicid}</td>
                      <td>${item.djhm}</td>
                      <td>${item.brxm}</td>
                      <td><#if item.brxb==1>男<#else>女</#if></td>
                      <td>${item.csrq}</td>
                      <td>${item.djdw.dwmc}</td>
                      <td>${item.djrq}</td>
                      <td><#if item.submit?? && item.submit>已提交<#else><span class="error">未完成</span></#if></td>
                      <td nowrap="nowrap">
                        <#if item.submit?? && item.submit>
                          <img src="img/a1.gif" width="9" height="9" />
                          <span> [</span><a href="${basePath}brxx/view.do?kicid=${item.kicid}">查看</a><span>]</span>
                          <#if item.ymjg??>
                          <img src="img/a1.gif" width="9" height="9" />
                          <span> [</span><a href="${basePath}ymjg/view.do?kicid=${item.ymjg.kicid}">结果</a><span>]</span>
                          </#if>
                          <#if dwdm_key.role.cancelBrxx>
                            <img src="img/002.gif" width="9" height="9" />
                            <span> [</span><a href="${basePath}brxx/reject.do?kicid=${item.kicid}" onclick="if(!confirm('你确定要把该病人信息卡退回吗？')){return false;}">退回</a><span>]</span>
                          </#if>
                        <#else>
                          <#if dwdm_key.role.editBrxx>
                            <img src="img/037.gif" width="9" height="9" />
                            <span> [</span><a href="${basePath}brxx/edit.do?kicid=${item.kicid}">修改</a><span>]</span>
                          </#if>
                          <#if dwdm_key.dwid==item.djdw.dwid && dwdm_key.role.delBrxx>
                            <img src="img/010.gif" width="9" height="9" />
                            <span> [</span><a href="${basePath}brxx/delete.do?kicid=${item.kicid}" onclick="if(!confirm('你确定要删除该病人信息吗？')){return false;}">删除</a><span>]</span>
                          </#if>
                        </#if>
                      </td>
                    </tr>
                    </#list>
                  </table>
                </td>
                <td style="background: url(${basePath}img/tab_16.gif); width: 9px;">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td>
            <table width="100%">
              <tr>
                <td width="15" height="29" style="background: url('img/tab_20.gif') no-repeat;">&nbsp;</td>
                <td style="background: url(img/tab_21.gif) repeat-x;">
                  <table>
                    <tr>
                      <td width="25%" height="29" nowrap="nowrap">
                        <span>共${pagination.totalCount}条纪录，当前第${pagination.pageNo}/${pagination.totalPage}页，每页&nbsp;<input name="pageSize" value="${pagination.pageSize}" class="w20" onkeypress="if(event.keyCode==13){$('#brxxListForm').submit();}"/>&nbsp;条纪录</span>
                      </td>
                      <td width="100000"></td>
                      <td>
                        <table width="340">
                          <tr align="center" valign="middle" style="height: 22px;">
                            <td width="48"><img id="first" src="img/first.gif" width="37" height="15" /></td>
                            <td width="52"><img id="back" src="img/back.gif" width="43" height="15" /></td>
                            <td width="52"><img id="next" src="img/next.gif" width="43" height="15" /></td>
                            <td width="48"><img id="last" src="img/last.gif" width="37" height="15" /></td>
                            <td width="52">转到第</td>
                            <td width="35"><input id="pageNo" name="pageNo" value="${pagination.pageNo}" style="width: 30px;" onkeypress="if(event.keyCode==13){$('#brxxListForm').submit();}"/></td>
                            <td width="23">页</td>
                            <td width="30"><img src="img/go.gif" class="pointer" width="37" height="15" onclick="$('#brxxListForm').submit();" /></td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                </td>
                <td width="14" height="29" style="background: url('img/tab_22.gif') no-repeat;">&nbsp;</td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </form>
    <#include "/template/common/alert_message.html"/>
  </body>
</html>
